
import axios from "../utils/request";

export function GetUser(data) {
    return axios({
        method: 'post',
        url: '/api/User/GetUser',
        data: data
    });
}
export function AddUser(data) {
    return axios({
        method: 'post',
        url: '/api/User/AddUser',
        data: data
    });
}
export function Show(params) {
    return axios({
        method: 'get',
        url: '/api/User/ShowUser',
        params: params
    });
}
export function Del(id) {
    return axios({
        method: 'delete',
        url: '/api/User/DelUser',
        params: {
            id: id
        }
    });
}

export function ByUsers(id) {
    return axios({
        method: 'get',
        url: '/api/User/ByUser',
        params: {
            id: id
        }
    });
}
export function RoleShow() {
    return axios({
        method: 'get',
        url: '/api/Role/GetRole',

    });
}
export function AddRole(data) {
    return axios({
        method: 'post',
        url: '/api/Role/AddRole',
        data: data
    });
}
export function GetDelet(id) {
    return axios({
        method: 'delete',
        url: '/api/Role/GetDelet',
        params: {
            id: id
        }
    });
}
export function RoleById(id) {
    return axios({
        method: 'get',
        url: '/api/Role/RoleById',
        params: {
            id: id
        }
    });
}

export function UpeRole(data) {
    return axios({
        method: 'post',
        url: '/api/Role/UpeRole',
        data: data
    });
}


export function Captcha(id) {
    return axios({
        method: 'get',
        url: '/api/User/Captcha',
        params: {
            id: id
        }
    });
}


export function GetMenu() {
    return axios({
        method: 'get',
        url: '/api/Menu/GetMenu',
    });
}
export function PostMenu(data) {
    return axios({
        method: 'post',
        url: '/api/Menu/PostMenu',
        data: data
    });
}
export function MenuById(id) {
    return axios({
        method: 'get',
        url: '/api/Menu/MenuById',
        params: {
            id: id
        }
    });
}

export function DelMenu(id) {
    return axios({
        method: 'delete',
        url: '/api/Menu/DelMenu',
        params: {
            id: id
        }
    });
}
export function MenuUpd(data) {
    return axios({
        method: 'post',
        url: '/api/Menu/MenuUpd',
        data: data
    });
}


export function GetUserRole() {
    return axios({
        method: 'get',
        url: '/api/Role/GetUserRole',
    });
}

export function AddRolePermission(data) {
    return axios({
        method: 'post',
        url: '/api/RolePermission/AddRolePermission',
        data: data
    });
}

export function GetByid(id) {
    return axios({
        method: 'get',
        url: '/api/RolePermission/GetByid',
        params: {
            id
        }
    });
}

export function AddUserRoles(data) {
    return axios({
        method: 'post',
        url: '/api/UserRole/AddUserRoles',
        data: data
    });
}

